word_to_id = {
  'name': 'zzy',
  'age': 14,
  'height': 170
}
data = ['name', 'height']

result = [word_to_id[word] for word in data if word in word_to_id]
print result